import Vue from 'vue'
import Vuex from 'vuex'
import axios from "axios";
Vue.use(Vuex)
export default new Vuex.Store({
  state:{
    isTabbarShow : true,
    comingList:[]
  },
  mutations:{
    isTabber(state,data){
      state.isTabbarShow = data
    },
    showtabber(state,data){
      state.isTabbarShow = data;
    },
    comingListAction(state,data){
    state.comingList = data;
    }
  },
  actions:{
      getcomingListAction(store){
        axios({
          url:"https://m.maizuo.com/gateway?cityId=110100&pageNum=1&pageSize=10&type=2&k=483965",
          headers:{
            'X-Client-Info': '{"a":"3000","ch":"1002","v":"5.0.4","e":"16200862756251397913772033","bc":"110100"}',
            'X-Host': 'mall.film-ticket.film.list'
          }
        }).then(res=>{
          store.commit("comingListAction",res.data.data.films)
        })
      }
  }
})
